using System;
using Microsoft.Xna.Framework.Graphics;



namespace HOPE {
	/// <summary>
	/// Represents an animated texture.
	/// </summary>
	/// <remarks>
	/// Currently, this class assumes that each frame of animation is
	/// as wide as each animation is tall. The number of frames in the
	/// animation are inferred from this.
	/// </remarks>
	class Animation {
		public Texture2D Texture {
			get { return texture; }
		}
		Texture2D texture;

		//durasi tiap frame
		public float FrameTime {
			get { return frameTime; }
		}
		float frameTime;

		public bool IsLooping {
			get { return isLooping; }
		}
		bool isLooping;

		public int FrameCount {
			get { return Texture.Width / FrameWidth; }
		}

		public int FrameWidth {
			get { return frameWidth; }
			set {
				if (value <= texture.Height) FrameWidth = value;
			}
		}
		int frameWidth;

		public int FrameHeight {
			get { return Texture.Height; }
		}

		public Animation (Texture2D texture, float frameTime, bool isLooping/*, int frameWidth*/) {
			this.texture = texture;
			this.frameTime = frameTime;
			this.isLooping = isLooping;
			//this.frameWidth = frameWidth;
		}
	}
}
